#include <stdio.h>

int a[10] = {2, 4, 16, 17, 25, 34, 78, 203, 350};

int main()
{
    int i, n, pos = 9;
    scanf("%d", &n);

    for (i = 0; i < 9; i++)
    {
        if (a[i] > n)
        {
            pos = i;
            break;
        }
    }

    for (i = 8; i >= pos; i--)
    {
        a[i + 1] = a[i];
    }

    a[pos] = n;

    for (i = 0; i < 10; i++)
    {
        printf("%5d", a[i]);
    }

    return 0;
}